@ Lec08-Stack_Frame

foo:
	sub sp, sp, #4
	str r5, [sp]
	sub sp, sp, #4
	str r6, [sp]
	sub sp, sp, #4
	str lr, [sp]
@=======================
	mov r5, #1
L1:
	cmp r1, #0
	beq DONE
	mul r6, r5, r0
	mov r5, r6
	sub r1, r1, #1
	b L1
DONE:
	mov r0, r5
	bl bar
@=======================
	ldr lr, [sp]
	add sp, sp, #4
	ldr r6, [sp]
	add sp, sp, #4
	ldr r5, [sp]
	add sp, sp, #4
	mov pc, lr
@=======================
bar:
	sub sp, sp, #4
	str lr, [sp]
	mul r1, r0, r0
	mov r0, r1
	bl inc
	ldr lr, [sp]
	add sp, sp, #4
	mov pc, lr
@=======================
inc:
	add r0, r0, #1
	mov pc, lr